﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileUpload.aspx.cs" Inherits="Imageo.ui.FileUpload" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

</head>
<body style="background: white;">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager" runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/js/jquery-1.4.2.min.js" />
            <asp:ScriptReference Path="~/js/jquery-ui-1.8.1.custom.min.js" />
            <asp:ScriptReference Path="~/js/swfupload.js" />
            <asp:ScriptReference Path="~/js/handlers.js" />
        </Scripts>
    </asp:ScriptManager>

    <script type="text/javascript">
        var swfu;

        function ResolveUrl(url) {
            if (url.indexOf("~/") == 0) {
                url = '<%# ResolveUrl("~/") %>' + url.substring(2);
            }
            return url;
        }

        $(document).ready(function() {
            swfu = new SWFUpload({
                // Backend Settings
                upload_url: "fileUpload2.aspx",
                post_params: {
                    "ASPSESSID": "<%=Session.SessionID %>"
                },

                // File Upload Settings
                file_size_limit: "2 MB",
                file_types: "*.jpg; *.jpeg",
                file_types_description: "Images",
                file_upload_limit: "0",    // Zero means unlimited

                // internal settings
                file_queue_error_handler: fileQueueError,
                file_dialog_complete_handler: fileDialogComplete,
                upload_progress_handler: uploadProgress,
                upload_error_handler: uploadError,
                upload_success_handler: uploadSuccess,
                upload_complete_handler: uploadComplete,

                // Button settings
                button_image_url: "../images/XPButtonNoText_160x22.png",
                button_placeholder_id: "spanButtonPlaceholder",
                button_width: 160,
                button_height: 22,
                button_text: '<span class="button">Select Images <span class="buttonSmall">(2 MB Max)</span></span>',
                button_text_style: '.button { font-family: Helvetica, Arial, sans-serif; font-size: 14pt; } .buttonSmall { font-size: 10pt; }',
                button_text_top_padding: 1,
                button_text_left_padding: 5,

                // Flash Settings
                flash_url: "../js/swfupload.swf", // Relative to this file

                custom_settings: {
                    upload_target: "divFileProgressContainer"
                },

                // Debug Settings
                debug: false
            });
        });
    </script>

    <div style="width: 380px; text-align: center">
        <div style="text-align: center">
            <div id="swfu_container" style="margin: 0px 10px;">
                <div>
                    <span id="spanButtonPlaceholder"></span>
                </div>
                <div id="divFileProgressContainer" style="height: 75px;">
                </div>
                <div id="thumbnails">
                </div>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
